#include <iostream>
#include <cstdlib>
using namespace std;

void EZloan() 
{

double initLoan = 0;
double initInterest = 0;
double initMonthly = 0;

double newInterest = 0;
double newLoan = 0;
double principal = 0;
double monthlyInterest = 0;
double firstPayInt = 0;
double firstPrinc = 0;

int monthCount = 0;

cout << "Enter the amount of the loan: $";
    cin >> initLoan;
    newLoan = initLoan;
    cout << "Enter the interest amount: %";
    cin >> initInterest;
    newInterest = initInterest;
    monthlyInterest = newInterest*0.01 / 12;
    cout << "Enter the monthly payment: $";
    cin >> initMonthly;
    
    while (newLoan >= 0)
    {
        principal = initMonthly - newLoan*monthlyInterest;
        newLoan = newLoan - principal;
        monthCount++;

    cout << "Your loan will take approximately " << monthCount << " months to pay off." << endl;

    }


}